<template>

  <div style="width:100%; padding:10px;"> <br><br><br><br>
    <p style="text-align: center; margin:auto; padding: 20px 50px 20px 0px;"> <span
        style="font-size:26px; font-weight:700;">东莞市厚街医院</span> <br> <span
        style="font-size:26px; font-weight:700;">临床发血单</span> </p>
    <table style="border-collapse: collapse; width:90%; left:20px;position:relative;">
      <tr>
        <td style="text-align:left;"> <span style="font-weight:600;">
            姓名：</span>{{item.traPatient.name}}</td>
        <td style="text-align:left;"> <span style="font-weight:600;">
            性别：</span>{{getEnum("BasSex",item.traPatient.sex) }}</td>
        <td style="text-align:left;"> <span style="font-weight:600;">
            年龄：</span>{{item.traPatient.age}}</td>
      </tr>
      <tr>
        <td style="text-align:left;"> <span style="font-weight:600;">
            患者ID：</span>{{item.traPatient.hospitalNumber}}</td>
        <td style="text-align:left;"> <span style="font-weight:600;">
            患者病区：</span>{{getBasMaterial("Department",item.traPatient.dependency) }}</td>
        <td style="text-align:left;"> <span style="font-weight:600;">
            床号：</span>{{item.traPatient.berth}} </td>
      </tr>
      <tr>
        <td v-if="  item.reviewDetail.aboResult === undefined " style="text-align:left;">
          <span style="font-weight:600;"> 患者血型：</span>
          {{  item.traPatient.abo  }} , {{ item.traPatient.rhD  }}
        </td>
        <td v-else style="text-align:left;">
          <span style="font-weight:600;"> 患者血型：</span>
          {{  item.reviewDetail.aboResult  }} ,{{ item.reviewDetail.rhDResult }}
        </td>
        <td style="text-align:left;" colspan="2"> <span style="font-weight:600;">
            申请医生：</span>{{getUserName(item.traMaster.creatorUserId)}}</td>
      </tr>
      <tr>
        <td style="text-align:left;" colspan="3"> <span style="font-weight:600;">
            临床诊断：</span>{{item.traPatient.clinicDiagnose}}</td>
      </tr>
    </table>
    <table style="border-collapse: collapse; width:95%;margin-top:5px;position:relative;">
      <tr>
        <td style="border:1px solid black; text-align: center;font-weight:600;font-size:15px">血液流水号</td>
        <td style="border:1px solid black; text-align: center;font-weight:600;font-size:15px">血型</td>
        <td style="border:1px solid black; text-align: center;font-weight:600;font-size:15px">容量</td>
        <td style="border:1px solid black; text-align: center;font-weight:600;font-size:15px">血液品种</td>
        <td v-if="item.traDetail.basBloodVariety.isCrossMatch==true"
          style="border:1px solid black; text-align: center;font-weight:600;font-size:15px">配血结果</td>
        <td style="border:1px solid black; text-align: center;font-weight:600;font-size:15px">血制品有效期</td>
        <td style="border:1px solid black; text-align: center;font-weight:600;width:25%;font-size:15px">
          献血码粘贴处</td>
        <td style="border:1px solid black; text-align: center;font-weight:600;font-size:15px">输血前核对</td>
      </tr>
      <tr v-for="(message,i) in list" :key="i">
        <td style="border:1px solid black; text-align: center;font-size:15px">
          {{message.invBloodInfo.bloodDonationCode}}<br>{{message.invBloodInfo.basBloodProductId}}</td>
        <td style="border:1px solid black; text-align: center;font-size:15px">
          {{message.invBloodInfo.abo}}<br>
          RhD({{message.invBloodInfo.rhD}})</td>
        <td style="border:1px solid black; text-align: center;font-size:15px">
          {{message.invBloodInfo.volume}}{{message.invBloodInfo.unit}}</td>
        <td style="border:1px solid black; text-align: center;font-size:15px">
          {{message.invBloodInfo.basBloodProduct.name}}</td>
        <td v-if="item.traDetail.basBloodVariety.isCrossMatch==true"
          style="border:1px solid black; text-align: center;font-size:15px">
          {{ getEnum("TraCrossMatchResult",message.result)}}</td>
        <td style="border:1px solid black; text-align: center;font-size:15px">
          {{message.invBloodInfo.effectiveDate.slice(0, 10)}}<br>
          {{message.invBloodInfo.effectiveDate.slice(11, 16)}} </td>
        <td style="border:1px solid black; text-align: center;;font-size:15px"></td>
        <td style="border:1px solid black; text-align: center;font-size:15px"></td>
      </tr>
      <tr>
        <td colspan="9" id="heji" style="border:1px solid black;text-align:left;font-size:15px"><span
            style="">备注：</span>{{item.master.remark}}</td>
      </tr>
    </table>
    <table style="border-collapse: collapse;width:90%;left:20px;margin-top:20px;position:relative;">
      <tr>
        <td style="text-align:left;width:50%;"> <span style="font-weight:600;">
            发血人：</span>{{getUserName(item.master.sendUserId)}}</td>
        <td style="text-align:left;width:50%;"> <span style="font-weight:600;">
            发血时间：</span>{{item.master.creationTime}}</td>
      </tr>
      <tr>
        <td style="text-align:left;width:50%;"> <span style="font-weight:600;">
            取血人：</span>{{getUserName(item.master.receiveUserId)}}</td>
        <td style="text-align:left;width:50%;"> <span style="font-weight:600;">
            取血时间：</span>{{item.master.auditTime}}</td>
      </tr>
    </table>
    <table v-if="item.isXR===true"
      style="border-collapse: collapse;width:760px;left:20px;margin-top:20px;position:relative;">
      <tr>
        <td style="text-align:left;">紧急发放-相容性检测实验未完成</td>
      </tr>
    </table>
  </div>

</template>

<script>
export default {
  name: "NursingPrint",
  methods: {
    //getBasMaterial(UserId)  //根据用户ID获取用户名
    getUserName() {
      return "username"
    },

    //getEnum("BasSex",id) //获取枚举名称
    getEnum() {
      return "未知"
    },

    //getBasMaterial("Department",id) //获取部门
    //getBasMaterial("BloodVariety",id) //获取血液品种名称
    //getBasMaterial("BloodVariety",id) //获取血液产品名称
    getBasMaterial() {
      return "xxx"
    },
  },
  data: function () {
    return {
      item: {
        traPatient: {
          billNo: "APL200720002",
          patientId: "72000080",
          hospitalNumber: "72000080",
          name: "马云珍",
          sex: 0,
          age: "54岁",
          birthday: "1966-03-17",
          dependency: "610101",
          apanage: 0,
          abo: "O",
          rhD: "+",
          transfuseHistory: 1,
          reactionHistory: 0,
          gestationHistory: 0,
          parturitionHistory: 0,
          transplantMatchHistory: 0,
          basDepartmentId: "610101",
          basSingleDiseaseId: null,
          patientType1: 1,
          patientType2: 1,
          isWrittenConsent: true,
          berth: "1317",
          clinicDiagnose: "多发性骨盆骨折，失血性休克",
          traAim: "纠正贫血",
          result: null,
          visitId: "",
          traZyzt: 0,
          personII: "",
          admitDate: "NaN-NaN-NaN",
          visitCount: 1,
          clinicDiagnoseCode: "S32.701",
          cardCode: null,
          irregularAntibody: false,
          info1: null,
          info2: null,
          info3: null,
          info4: null,
          info5: null,
        },
        traDetail: {
          billNo: "APL200720002",
          basBloodVarietyId: 2,
          applyBloodType: "O",
          applyRhD: "+",
          applySum: 600,
          specialProcessing: null,
          replaceBloodVarietyId: null,
          remark: null,
          beforeSurgery: null,
          otherIllustrates: null,
          isTypeReview: false,
          basSxhlx: 0,
          varietyNorm: null,
          traSpecimenInfoId: 52,
          hasSum: 600,
          bloodOutSum: 600,
          basBloodVariety: {
            lastModifierUserId: 198,
            lastModificationTime: "2020-07-07 10:07:00",
            code: "3",
            name: "血浆",
            isEnabled: true,
            unit: "ml",
            isCrossMatch: false,
            basXyzl: 2,
            isQuantity: false,
            unitRate: 100,
            expirationTime: 3,
            id: 2,
          },
        },
        traMaster: {
          isOutpatient: null,
          middleAuditUserId: 493,
          middleAuditTime: "2020-07-20 01:37:10",
          middleAuditInfo: null,
          billNo: "APL200720002",
          manualNo: null,
          billType: null,
          billStatus: 3,
          auditUserId: 174,
          auditInfo: " 同意",
          auditTime: "2020-07-20 02:31:29",
          applyType: 5,
          isExigence: false,
          perTranTime: "2020-07-20 04:32:13",
          auditLevel: 2,
          traType: 5,
          traPerAppraiseBillNo: "",
          isDeleted: false,
          deleterUserId: null,
          deletionTime: null,
          lastModificationTime: "2020-07-20 02:37:24",
          lastModifierUserId: 174,
          creationTime: "2020-07-20 01:36:11",
          creatorUserId: 130,
          id: "APL200720002",
        },
        traMaster: {
          departmentAuditUserId: null,
          departmentAuditTime: null,
          isOutpatient: null,
          middleAuditUserId: 1073,
          middleAuditTime: "2020-08-18 09:52:54",
          middleAuditInfo: " 同意",
          billNo: "APL200818003",
          manualNo: null,
          billType: null,
          billStatus: 3,
          auditUserId: 922,
          auditInfo: "",
          auditTime: "2020-08-18 13:54:49",
          applyType: 5,
          isExigence: false,
          perTranTime: "2020-08-18 15:54:17",
          auditLevel: 2,
          traType: 5,
          traPerAppraiseBillNo: "",
          isDeleted: false,
          deleterUserId: null,
          deletionTime: null,
          lastModificationTime: "2020-08-18 15:15:29",
          lastModifierUserId: 922,
          creationTime: "2020-08-18 09:52:26",
          creatorUserId: 78,
          id: "APL200818003",
        },
        basPatient: {
          id: "72000080",
          hospitalNumber: "72000080",
          name: "马云珍",
          sex: 0,
          age: "54岁",
          birthday: "1966-03-17",
          apanage: 0,
          abo: "O",
          rhD: "+",
          transfuseHistory: 1,
          reactionHistory: 0,
          gestationHistory: 1,
          parturitionHistory: 1,
          transplantMatchHistory: 0,
          matchHistory: 0,
          lastTypeReviewBillNo: "REV200730001",
          lastTypeReviewTime: "2020-07-30 11:55:40",
          typeReviewBillDetail: {
            billNo: "REV200730001",
            aboPositive: "O",
            aboNegative: "O",
            aboResult: "O",
            aboBloodTyping: 25,
            rhBloodTyping: 26,
            subtype: null,
            rhDResult: "+",
            antibodyScreen1: null,
            antibodyScreen2: null,
            antibodyScreen3: null,
            antibodyScreenResult: 0,
            antiHumanGlobulin: null,
            irregularAntibody: null,
            plAntiScreen: null,
            plInspectDate: null,
          },
          personII: "",
        },
        reviewDetail: {},
        reviewMaster: {},
        master: {
          billNo: "BOU200720002",
          manualNo: null,
          billType: null,
          billStatus: 3,
          auditUserId: 174,
          auditTime: "2020-07-20 02:37:24",
          remark: null,
          traApplyBillNo: "APL200720002",
          beforeTemperature: null,
          receiveUserId: 14,
          informReceiveDate: null,
          creatorUserId: 174,
          creationTime: "2020-07-20 02:37:16",
          sendUserId: 174,
          isBloodOut: true,
          traTypeReviewBillNo: null,
          basDepartmentId: "610101",
          hasSum: null,
        },
        reportTime: "2020-08-05 12:22:37",
        matchingUserName: "测试",
        reviewUserName: "测试2",
      },
      name: "血液交叉配血报告单",
      list: [
        {
          billNo: "BOU200720002",
          invBloodInfoId: 175,
          traPxffId: null,
          reviewTraPxffId: null,
          result: null,
          matchingDate: null,
          traCrossMatchBillNo: null,
          invBloodInfo: {
            code: "0201019062153P0173V00",
            ownNumber: null,
            basBloodProductId: "P0173V00",
            basBloodProductName: null,
            abo: "O",
            rhD: "+",
            volume: 200,
            unit: "ML",
            warehousingPrice: 80,
            status: 1,
            specialProcessing: null,
            effectiveDate: "2024-06-15 11:12:00",
            gatheringDate: "2020-06-15 03:12:00",
            makeDate: null,
            bloodDonationCode: "0201019062153",
            isRecycle: false,
            basBloodProduct: {
              id: "P0173V00",
              code: "P0173V00",
              name: "病毒灭活冰冻血浆",
              basBloodVarietyId: 2,
              basBloodVarietyName: "血浆",
              volume: 1,
              price: 0.4,
              femininePrice: 0.4,
              xzPrice: 0,
              hisCode: "7702046",
              isEnabled: true,
              lastModifierUserId: 0,
              lastModificationTime: "2020-06-23 12:17:51",
              creatorUserId: 0,
              creationTime: "2020-06-23 12:17:51",
              basBloodVariety: null,
            },
            sinceNumber: null,
            bloodAppearance: null,
            isDeleted: false,
            deleterUserId: null,
            deletionTime: null,
            lastModificationTime: "2020-07-20 02:37:24",
            lastModifierUserId: 174,
            creationTime: "2020-06-30 00:00:00",
            creatorUserId: 2,
            id: 175,
          },
          isReturn: false,
          traTscl: null,
          matchingUserId: null,
          reviewUserId: null,
        },
        {
          billNo: "BOU200720002",
          invBloodInfoId: 374,
          traPxffId: null,
          reviewTraPxffId: null,
          result: null,
          matchingDate: null,
          traCrossMatchBillNo: null,
          invBloodInfo: {
            code: "0201019061843P0173V00",
            ownNumber: null,
            basBloodProductId: "P0173V00",
            basBloodProductName: null,
            abo: "O",
            rhD: "+",
            volume: 200,
            unit: "ML",
            warehousingPrice: 80,
            status: 1,
            specialProcessing: null,
            effectiveDate: "2024-05-14 16:57:00",
            gatheringDate: "2020-05-14 08:57:00",
            makeDate: null,
            bloodDonationCode: "0201019061843",
            isRecycle: false,
            basBloodProduct: {
              id: "P0173V00",
              code: "P0173V00",
              name: "病毒灭活冰冻血浆",
              basBloodVarietyId: 2,
              basBloodVarietyName: "血浆",
              volume: 1,
              price: 0.4,
              femininePrice: 0.4,
              xzPrice: 0,
              hisCode: "7702046",
              isEnabled: true,
              lastModifierUserId: 0,
              lastModificationTime: "2020-06-23 12:17:51",
              creatorUserId: 0,
              creationTime: "2020-06-23 12:17:51",
              basBloodVariety: null,
            },
            sinceNumber: null,
            bloodAppearance: null,
            isDeleted: false,
            deleterUserId: null,
            deletionTime: null,
            lastModificationTime: "2020-07-20 02:37:24",
            lastModifierUserId: 174,
            creationTime: "2020-06-30 00:00:00",
            creatorUserId: 2,
            id: 374,
          },
          isReturn: false,
          traTscl: null,
          matchingUserId: null,
          reviewUserId: null,
        },
        {
          billNo: "BOU200720002",
          invBloodInfoId: 375,
          traPxffId: null,
          reviewTraPxffId: null,
          result: null,
          matchingDate: null,
          traCrossMatchBillNo: null,
          invBloodInfo: {
            code: "0201019098162P0173V00",
            ownNumber: null,
            basBloodProductId: "P0173V00",
            basBloodProductName: null,
            abo: "O",
            rhD: "+",
            volume: 200,
            unit: "ML",
            warehousingPrice: 80,
            status: 1,
            specialProcessing: null,
            effectiveDate: "2024-05-14 16:56:00",
            gatheringDate: "2020-05-14 08:56:00",
            makeDate: null,
            bloodDonationCode: "0201019098162",
            isRecycle: false,
            basBloodProduct: {
              id: "P0173V00",
              code: "P0173V00",
              name: "病毒灭活冰冻血浆",
              basBloodVarietyId: 2,
              basBloodVarietyName: "血浆",
              volume: 1,
              price: 0.4,
              femininePrice: 0.4,
              xzPrice: 0,
              hisCode: "7702046",
              isEnabled: true,
              lastModifierUserId: 0,
              lastModificationTime: "2020-06-23 12:17:51",
              creatorUserId: 0,
              creationTime: "2020-06-23 12:17:51",
              basBloodVariety: null,
            },
            sinceNumber: null,
            bloodAppearance: null,
            isDeleted: false,
            deleterUserId: null,
            deletionTime: null,
            lastModificationTime: "2020-07-20 02:37:24",
            lastModifierUserId: 174,
            creationTime: "2020-06-30 00:00:00",
            creatorUserId: 2,
            id: 375,
          },
          isReturn: false,
          traTscl: null,
          matchingUserId: null,
          reviewUserId: null,
        },
      ],
    }
  },
}
</script>
